"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.loadStyle = exports.loadScript = void 0;
/**
 * 加载 <script src> 样式
 * @param src
 */
const loadScript = (src, callback) => {
  const script = document.createElement('script');
  script.src = src;
  script.type = 'text/javascript';
  script.onload = () => {
    callback?.();
  };
  document.body.appendChild(script);
};

/**
 * 加载 <link href> 样式
 * @param href
 */
exports.loadScript = loadScript;
const loadStyle = (href, callback) => {
  const link = document.createElement('link');
  link.href = href;
  link.rel = 'stylesheet';
  link.type = 'text/css';
  document.head.appendChild(link);
};
exports.loadStyle = loadStyle;